﻿@model ScmCostactualViewModel
@{
    Layout = null;
    ViewBag.Title = "费用使用-添加";

}
<script type="text/javascript">
    //使用费用计划
    function LoadCostPlan() {
        if ($("#TheScmCostactualmainInfo_Cam_Section").val() == "") {
            alert("请选择施工单位信息！");
            return;
        }
        if ($("#yearmonth").val() == "") {
            alert("请选择年份！");
            return;
        }
        $("#div_Units").loadUrl('/SafetyConstruction/ScmCostActual/CostActualUnitSel?tag=1', "section=" + $("#TheScmCostactualmainInfo_Cam_Section").val() + "&yearmonth=" + escape($("#yearmonth").val()), null);
    }

</script>
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function dialogRefresh(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            $("#pagerForm", navTab.getCurrentPanel()).submit();
            $.pdialog.closeCurrent();
        }
    }
</script>
@{Html.EnableClientValidation();}
@using (Html.BeginForm("CostActualAddData", "ScmCostActual", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogRefresh);", @class = "pageForm required-validate" }))
{
    <div class="pageContent">
        <div class="pageFormContent" layouth="60">
            <dl>
                <dt style="text-align:right">施工单位：</dt>
                <dd>
                    @Html.TextBoxFor(m => m.TheScmCostactualmainInfo.Cam_ConstructionID, new { @type = "hidden" })
                    @Html.TextBoxFor(m => m.TheScmCostactualmainInfo.Cam_ConstructionName, new Dictionary<string, object> { { "class", "data-val-required input02" }, { "readonly", "readonly" } })
                    @Html.ValidationMessageFor(m => m.TheScmCostactualmainInfo.Cam_ConstructionName)
                    <a class="btnLook" href="@Url.Action("UnitList", "ProjectSegment", new { uId = "TheScmCostactualmainInfo_Cam_ConstructionID", uName = "TheScmCostactualmainInfo_Cam_ConstructionName", uSection = "TheScmCostactualmainInfo_Cam_Section" })" lookupgroup="TheScmCostactualmainInfo" title="选择施工单位">查找带回</a>
                </dd>
            </dl>
            <dl>
                <dt style="text-align:right">标段：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_Section, new { @class = "required", @readonly = "readonly" })
            </dl>
            <dl>
                <dt style="text-align:right">上报时间：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_ReportTime,
                    new { @class = "date", @readonly = "readonly", Value = DateTime.Now.ToString("yyyy-MM-dd") })
                </dd>
            </dl>
            <dl>
                <dt style="text-align:right">年份：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.TheScmCostactualmainInfo.Cam_YearMonth,
                             new { @id = "yearmonth", @class = "date", @readonly = "readonly", format = "yyyy-MM", Value = DateTime.Now.ToString("yyyy-MM") })
                    @Html.ValidationMessageFor(m => m.TheScmCostactualmainInfo.Cam_YearMonth)
            </dl>
            <dl><dt><button type="button" onclick="LoadCostPlan()">导入费用计划</button></dt></dl>
            <div class="divider"></div>
            <div class="panelBar">

                <ul class="toolBar">
                    <li class="nobg"><b>费用统计表</b></li>
                </ul>

            </div>
            <div id="div_Units">
                @Html.Partial("~/Areas/SafetyConstruction/Views/ScmCostActual/CostActualUnitSel.cshtml", Model.TheCostActualList)
                </div>

                <div class="tabsFooter">
                    <div class="tabsFooterContent"></div>
                </div>
            </div>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <button type="submit" class="btn btn-sm">保存</button>
            </li>
            <li>
                <button type="button" class="close btn btn-default btn-sm">取消</button>
            </li>

        </ul>
    </div>
}
